package laboratoryQ.ui.draw.style;

import java.awt.Color;

import laboratoryQ.experiment.ui.UIUtils;

public class PaintDiaItem implements IStylizer {
	private Color[] colors = UIUtils.COLORS_COLLECTION;

	public PaintDiaItem() {
	}

	public PaintDiaItem(Color[] colors) {
		this.colors = colors;
	}

	@Override
	public void fillStyle(IStyle style) {
		for (IStyleProperty p : style.listPropertices()) {
			if (p instanceof DiagramItemColorProperty) {
				DiagramItemColorProperty dicp = 
					(DiagramItemColorProperty) p;
				int pos = dicp.diaItemPosition % colors.length;
				p.setValue(colors[pos]);
			}
		}
	}
}
